package com.ljxt.dt.service.purchasingmanagementservice.impl;

import com.ljxt.dt.dao.purchasingmanagementdao.PurchaseDetailDao;
import com.ljxt.dt.dao.purchasingmanagementdao.impl.PurchaseDetailDaoImpl;
import com.ljxt.dt.domain.GoodsInfo;
import com.ljxt.dt.domain.PurchaseDetail;
import com.ljxt.dt.domain.SupplierInfo;
import com.ljxt.dt.service.purchasingmanagementservice.PurchaseDetailService;

import java.util.List;

/**
 * @author 徐浩钦
 * @version 1.0.0
 * @date 2020/5/11 15:24
 * @copyright 老九学堂T11
 */
public class PurchaseDetailServiceImpl implements PurchaseDetailService {
    private static PurchaseDetailDao purchaseDetailDao = new PurchaseDetailDaoImpl();

    @Override
    public List<GoodsInfo> selectGoodsByPurchaseId(String id) {
        return purchaseDetailDao.selectGoodsByPurchaseId(id);
    }

    @Override
    public List<PurchaseDetail> selectAll(int pageIndex, int pageSize) {
        return purchaseDetailDao.selectAll(pageIndex,pageSize);
    }

    @Override
    public SupplierInfo selectSupplierInfoByGoods(int id) {
        return purchaseDetailDao.selectSupplierInfoByGoods(id);
    }

    @Override
    public SupplierInfo selectSupplierInfoByPurchaseId(String id) {
        return purchaseDetailDao.selectSupplierInfoByGoods(purchaseDetailDao.selectGoodsByPurchaseId(id).get(0).getId());
    }
}
